<!DOCTYPE html>
<!--suppress ALL-->
<html lang="en"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.thymeleaf.org"
      layout:decorator="layout/master">

<body layout:fragment="content">
<link rel="stylesheet" type="text/css" href="/css/mui.min.css">
<script src="/js/layer/layer.js"></script>
<div th:replace="layout/layout::center_zy_search_top_box('我要提现')"></div>
<input type="hidden" id="minWithdraw" th:value="${minWithdraw}">
<!-- 内容框 -->
<div class="zy_module-content">
    <div class="vip_user_addr_new">
        <div class="box dizhi_new">
            <form id="form1">
                <div class="txt">
                    <h4>可申请提现:[[${money}]] 元 <span style="color: red;font-size: 9px">最小提现金额为 [[${minWithdraw}]] 元</span></h4>
                    <h5>姓名：[[${pddUserBankcards.name}]]</h5>
                    <h5>账号：[[${pddUserBankcards.number}]]</h5>
                    <h2><input type="text" id="cash" placeholder="提现金额"></h2>

                </div>
                <button type="button" onclick="withdraw()">申请提现</button>
            </form>
        </div>
    </div>
</div>
<script src="/js/layer/layer.js"></script>
<script>
    function withdraw() {
        var cash=$("#cash").val();
        var minWithdraw=$("#minWithdraw").val();
        if (parseFloat(cash)<parseFloat(minWithdraw)){
            layer.msg("提现最小金额为 " + minWithdraw + " 元");
            return;
        }
        $.post("/ajax/center/applyWithdraw", {actualCash:cash, cash: cash}, function (d) {
            if (d.code == 0) {
                layer.msg("申请成功");
            } else {
                layer.msg(d.msg);
            }
        });
    }
</script>
</body>

</html>